Computer, control method for virtual device, and program thereof

ABSTRACT

A computer in which functions of its resources are divided to realize a plurality of virtual computers  12  and which includes a plurality of physical devices. A managing unit of the computer, when usage of a virtual device has changed, selects a physical device compatible with the virtual device from physical devices usable for a control scheme and makes the physical device be associated with the virtual device and changes the control scheme of the virtual device, thereby achieving the control of devices in the virtual computers, where a plurality of control schemes including a shared scheme and a dedicated scheme are switched.

CROSS-REFERENCE TO RELATED APPLICATIONS

The present application claims priority from Japanese Patent ApplicationNo. 2006-335803 filed on Dec. 13, 2006, which is herein incorporated byreference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to the control and management of a virtualcomputer system.

2. Description of the Related Art

In these years, a technology is drawing attention where resources on asingle computer are divided into multiple virtual computers and where asystem comprising the multiple computers is integrated in a small numberof physical computers. By reducing the number of physical computers, thereduction in power consumption and the simplification of management,thus, the reduction in operational costs can be achieved.

While the control technology for these virtual computers is drawingattention in these years because of advance in support techniques forconstructing a virtual computer system using inexpensive computers of aPC (Personal Computer) architecture or the like, the control technologyhas been realized mainly in the control of main frames (general-purposelarge-scale computers) or the like.

For such virtual computer systems, there are two schemes for controllingdevices such as a network interface card (NIC) and a SCSI (SmallComputer System Interface) card on computers. Hereinafter, devicesactually mounted on computers are called physical devices, and devicesrecognized by virtual computers are called virtual devices.

A first one of the schemes is a scheme where a hypervisor that is thecontrol unit (managing unit) of a virtual computer detects and analyzescontrol commands, issued to a virtual device from one or a number ofvirtual computers to emulate the operation of a physical device. Withthis scheme, overhead associated with the hypervisor is large andprocessing performance is degraded, while multiple virtual computers canshare a single physical device. Further, where multiple virtualcomputers share a single physical device, there are the problems that itis difficult to secure processing performance, e.g., when multiplevirtual computers use the physical device at the same time and that theperformance prediction is difficult. Hereinafter, this first scheme iscalled a shared scheme.

A second scheme is a scheme where a hypervisor manages associationbetween a particular physical device and a virtual computer and performsonly the division of computer resources and where the virtual computerdirectly controls the physical device. Hereinafter, the second scheme iscalled a dedicated scheme. With the dedicated scheme, operation is athigh speed, but physical devices cannot be shared.

Described in U.S. Pat. No. 4,887,202 (hereinafter called a reference 1)is a method that changes the scheme of controlling virtual devices fromthe shared scheme to the dedicated scheme, or from the dedicated schemeto the shared scheme in a virtual computer system having the twoschemes.

Described in U.S. Pat. No. 6,725,289 (hereinafter called a reference 2)is a method that monitors the usage of virtual devices under the sharedscheme and optimizes a page table of memory.

If in a practical system, all virtual devices are configured for thededicated scheme, the number of physical devices that are to be mountedin computers increases. However, since there is a limit to the number ofphysical devices mountable in computers, it is difficult to configureall virtual devices in the dedicated scheme.

Accordingly, it is important to configure a system where the sharedscheme and the dedicated scheme are mixed.

In some systems, depending on the usage of virtual devices, the sharedscheme may be enough in performance, or the dedicated scheme may beneeded in performance. Further, the usage of virtual devices may varyduring operation. In particular, in order to secure stable processingperformance in a system that varies in the usage, it is important toimmediately change the scheme according to the usage.

Further, whether a virtual device operating under the shared scheme canbe changed to operate under the dedicated scheme, or whether theopposite is possible depends on information about physical devicesmounted in the system, the settings of virtual devices and the physicaldevices, and the like. For example, when a virtual device under theshared scheme is changed to operate under the dedicated scheme, in ageneral architecture such as PC/AT (Personal Computer/AdvancedTechnology), an identifier such as the mounted position of the virtualdevice needs to be the same.

Although reference 1 describes a method of changing the control schemefor virtual devices, because information about the system configurationand the usage of the virtual devices are not managed, time to change thecontrol scheme and the control scheme to be used cannot be automaticallydetermined. Hence, an instruction to change must be given externally.

Also in reference 2, the control scheme to be used cannot beautomatically determined.

If a human manually performs that change, management cost will increaseproportionally to the number of computers, thus resulting in largemanagement cost. Moreover, if manual work time is necessary, the schemein use cannot be switched quickly. Thus, degradation in performance fora long time may be caused. Hence, a method of changing the controlscheme at high speed without manual intervention is needed.

Accordingly, a method of managing information about both the usage ofvirtual devices and the system configuration collectively anddetermining time to change the control scheme and the control scheme tobe used is needed.

SUMMARY OF THE INVENTION

The present invention was made in view of the above problems, and anobject thereof is to appropriately switch multiple control schemesincluding the shared scheme and the dedicated scheme as to the controlof virtual devices in virtual computers.

The present invention is a computer in which functions of its resourcesincluding a processing unit and memory are divided to realize aplurality of virtual computers and which includes a plurality ofphysical devices that are peripheral connecting devices or networkconnecting devices.

The computer comprises a managing unit that comprises the processingunit and the memory, manages the plurality of virtual computers and theplurality of physical devices, assigns the virtual computers thephysical devices as the virtual devices, and manages the virtual devicesaccording to one of a plurality of control schemes including a dedicatedscheme where a virtual device is associated with a physical device on aone-to-one basis and a shared scheme where a plurality of virtualdevices are associated with one physical device.

The managing unit has status information holding use-status informationindicating either an active status where the virtual device is in use oran inactive, status where the virtual device is hardly or not at all inuse; configuration information holding information about configurationsincluding respective address spaces of the physical devices and thevirtual devices; and association information holding information aboutassociation between the physical devices and the virtual devices.

The managing unit refers to the status information and, when determiningthat usage of the virtual device has changed, referring to theconfiguration information, selects a physical device compatible with thevirtual device from the physical devices usable for a control schemebased on at least one of a hardware specification, an identifier, and anaddress space, and makes the physical device be associated with thevirtual device in the association information and changes the controlscheme of the virtual device.

The other means will be described later.

BRIEF DESCRIPTION OF THE DRAWINGS

For a more complete understanding of the present invention and theadvantages thereof, reference is now made to the following descriptiontaken in conjunction with the accompanying drawings wherein:

FIG. 1 is a configuration diagram showing a computer and others;

FIG. 2 is a configuration diagram of a virtual computer system;

FIG. 3 shows an example of the configuration of a physical NIC statusmanager;

FIG. 4 shows an example configuration of a physical NIC list/virtual NIClist;

FIG. 5 shows an example configuration of a physical-virtual NIC mappinglist;

FIG. 6 shows an example configuration of the virtual computer system;

FIG. 7 shows an example of an access interface to an NIC;

FIG. 8 shows examples of the configuration of a processing unit of avirtual NIC controller;

FIG. 9 shows an example configuration and the like of a virtual NICstatus manager;

FIG. 10 shows an example configuration of command history information;

FIG. 11 shows an example configuration of command statisticsinformation;

FIG. 12 shows an example configuration of a process switching policy;

FIG. 13 is a flow chart showing the procedure of entering configurationinformation of a virtual computer;

FIG. 14 is a flow chart showing the procedure of executing the processswitching policy;

FIG. 15 is a flow chart showing the procedure of assigning a physicalNIC;

FIG. 16 is a flow chart showing the procedure of selecting a physicalNIC compatible with a virtual NIC;

FIG. 17 is a flow chart of the procedure for initializing a physicalNIC;

FIG. 18 shows an example sequence of the operation of a hypervisor whenchanging from a shared scheme to a direct dedicated scheme; and

FIG. 19 shows an example sequence of the operation of the hypervisorwhen changing from the shared scheme to an indirect dedicated scheme.

DETAILED DESCRIPTION OF THE INVENTION

The best mode for carrying out the invention (hereinafter called anembodiment) will be described below with reference to the drawings asneeded. Here, as to the control of virtual devices in virtual computers,as a representative example where it is effective to change (switch)between the shared scheme and the dedicated scheme depending on theusage of virtual devices, a device redundancy technique for increasingthe reliability of a computer will be described.

Although in this embodiment the term device refers to a SCSI card, anNIC, and an input/output apparatus, in other embodiments, it may referto those and similar apparatuses (other peripheral connecting andnetwork connecting apparatuses).

First, the premise and outline of this embodiment are as follows. Insystems of business companies, usually multiple devices are mounted on acomputer for redundancy in case a hardware failure occurs. As aredundancy scheme, there is a scheme where a device of an active system(or being active) and a device of a standby system (or being standby orinactive) are used.

In the above scheme, the same type of multiple devices that have theroles of the active system and the standby system are grouped into a setand treated virtually as one device.

In order to fulfill the function of the one device, the device havingthe role of the active system is usually used.

The device of the standby system is not used except when performing asmall number of accesses in order to confirm that the device has notfailed.

If the device of the active system has failed, the OS running on avirtual computer uses the device of the standby system as a replacedevice.

If all physical devices are used under the dedicated scheme, the numberof the devices increases. In the above redundancy configuration, becauseprocessing performance is not required of devices of the standby system,the standby system uses devices under the shared scheme, therebyreducing the total number of physical devices. Meanwhile, in the activesystem, devices are assigned in a dedicated manner, thereby securinghigh speed, stable processing performance.

Further, in a computer system, a small number of spare devices areprovided, and when a device of the standby system is used as a replacedevice for the active system, control software such as a hypervisordetects, a change in the usage of the device according to the controlscheme of the virtual computer system of the present embodiment. Then,the control scheme for the virtual device is changed from the sharedscheme to the dedicated scheme using the spare device. Thus, the controlscheme for the device can be changed according to the usage. In otherwords, processing performance can be secured continuously in response tochanges in the state of the system. These things will be described indetail below.

First Embodiment

Firstly, a first embodiment will be described. An example of theconfiguration of a computer 10 that has a virtual computer system runthereon will be described with reference to FIG. 1. FIG. 1 is aconfiguration diagram showing the computer 10, etc.

The computer 10 comprises one or more CPUs (Central Processing Units)201 (a collective number for 201-1 to 201-3; hereinafter similarrepresentation is used for other components) (processing units), whichare connected to a northbridge 203 via a front side bus 202.

The northbridge 203 is connected to memory 204 (storage) and an IO(Input/Output) bridge 205 and controls data transfers between the CPU201 and the memory 204 and between the memory 204 and the IO bridge 205.The northbridge 203 can be embodied by, e.g., an informationcommunication controlling LSI (Large Scale Integration) chip.

The IO bridge 205 is an intermediary device and connected to one or moreIO buses 206 such as a PCI (Peripheral Component Interconnect) bus andcontrols data transfers between IO devices connected to the IO buses 206and the northbridge 203.

Here, examples of the IO devices are a SCSI card 207 (a peripheral) forconnecting to an external storage 210, an NIC (Network Interface Card)208 (a network connecting device) for connecting to a network and aninput-output device 209 (a peripheral) for connecting to a keyboard, adisplay, and the like.

The CPU 201 reads a program stored on the memory 204 via the northbridge203 and executes it, and according to the program, issues commands tothe SCSI card 207, the NIC 208, and the like via the northbridge 203 andthe IO bridge 205 to execute data transfer control.

The memory 204 and the IO devices as a whole (the SCSI card 207, the NIC208, and the like) each have a unique address space (a memory areaaddressable) on the computer 10. The CPU 201 issues data transfercommands specifying the addresses of data transfer destinations. Thememory 204 and the IO devices execute data transfer from or to thespecified addresses.

Next, an example of the configuration of a virtual computer system thatcontrols the computer 10 will be described with reference to FIG. 2.FIG. 2 is a configuration diagram of the virtual computer system.

A hypervisor 11 (a managing unit) is embodied as a program such asfirmware or middleware that runs on the computer 10 (that is, realizedby the CPU 201 and the memory 204) and manages the control of thecomputer 10 and the control of virtual computers 12 (12-1 to 12-3) anddivides the resources of the single computer 10 so as to logicallyassign the divided resources to the multiple virtual computers 12. Sincethe hypervisor 11 is a program of a lower layer than an operating system(hereinafter called OS), at the start of the computer 10, after theexecution of a system initializing program such as a BIOS (BasicInput/Output System), the hypervisor 11 is directly executed without theintervention of the OS.

Under the control of the hypervisor 11, one or more virtual computers 12run on the computer 10. Each of the virtual computers 12 logically hasthe same configuration as shown in FIG. 1 but differs from the computer10 of FIG. 1 all of whose functions are embodied by hardware in that allor part of the control is executed through the operation of thehypervisor 11, a program. On each virtual computer 12, one OS 13 (13-1to 13-3) runs.

In the first embodiment, the redundancy of the NIC 208 as an example IOdevice will be described below using a PCI as an example of the IO bus206.

The computer 10 has at least one physical NIC 101 (101-1 to 101-4, asimilar representation to that of the NIC 208) as arm IO device. Herein,to distinguish from NICs 121 on the virtual computers 12, the NICs thatthe computer 10 has are called physical NICs.

Each virtual computer 12 has two or more virtual NICs 121. The OS 13running on the virtual computer 12 uses the virtual NICs 121 for aredundancy configuration.

The hypervisor 11 has a function to assign a particular physical NIC 101to a particular victual computer 12 in a dedicated manner. Where aphysical NIC 101 is assigned to a particular virtual computer 12, thephysical NIC 101 executes data transfer from and to only the virtualcomputer 12.

The hypervisor 11 has virtual NIC controllers 111 (111-1 to 111-2) andcan implement the functions of the virtual NICs 121 on the virtualcomputers 12 with programs. The virtual NIC controllers 111 execute NICcontrol according to multiple schemes described later with reference toFIG. 6.

As to the virtual NIC controller 111, a processing unit 115 thereofrefers to the redundancy status of the virtual NIC 121 and the systemconfiguration of the virtual computer 12 and selects the control schemefor the virtual NIC 121. A virtual NIC status manager 114 thereofmonitors the usage of the virtual NIC 121 and determines the redundancystatus.

The details of the control scheme for data transfer commands using thephysical NIC 101 will be described later.

A physical NIC status manager 113 manages the system configuration ofeach virtual computer 12. To be specific, it manages hardware(specification) configuration information of the physical NICs 101 whichthe computer 10 has, the system configurations of the virtual computers12, and the assignment of the virtual NICs 121 on the virtual computers12 and the physical NICs 101.

Next, the configuration managing method for the virtual computer 12 inthe virtual computer system and an example of the system configurationof the virtual computer 12 will be described.

FIG. 3 shows an example of the configuration of the physical NIC statusmanager 113.

A physical NIC information collector 304 and a physical NIC assigningunit 305 are programs running on the hypervisor 11, and a physical NIClist 301 (configuration information), a virtual NIC list 302(configuration information), and a physical-virtual NIC mapping list 303(association information) are in a data store area secured in the memory204 managed by the hypervisor 11.

The physical NIC information collector 304 is a function that collects,information about the hardware and software of the physical NICs 101 ofthe computer 10 and is embodied by a program running on the hypervisor11 or the like.

The physical NIC information collector 304 is executed at the time thatthe hypervisor 11 starts on the computer 10 and collects configurationinformation via a configuration space assigned to the physical NICs 101by the BIOS or the like to create the physical NIC list 301.

The physical NIC assigning unit 305 manages the association between thephysical NICs 101 and the virtual NICs 121 on the virtual computers 12and receives a request to associate a new virtual NIC 121 with aphysical NIC 101 from another function (component) and assigns aphysical NIC 101 that meets conditions.

The physical NIC list 301 is a list of information about the hardwareand software of the physical NICs 101 and is held in the form of atable. The physical NIC information collector 304 collects informationat the start of the computer 10 or the like and sets items in thephysical NIC list 301.

An example configuration of the physical NIC list 301 will be describedusing FIG. 4. FIG. 4 shows an example configuration of the physical NIClist 301.

In the physical NIC list 301, a MAC (Media Access Control) address 401of each physical NIC 101 is an identifier uniquely assigned to thephysical NIC 101 and held in a memory area of the physical NIC 101.

A device mounted position 403 is an identifier indicating the positionon a bus such as a PCI and determined by the position where the physicalNIC 101 is mounted on the computer 10. In the PCI, the device mountedposition 403 is used as an address when issuing commands to obtain andset basic information of the device.

A model name 402 is an identifier specifying the specification of thephysical NIC 101, and the command specification used when the OSaccesses is determined according to the model name 402.

An MMIO address 404 and an IO address 405 are addresses used to controlthe physical NIC 101, and data transfer from and to the physical NIC 301is controlled by specifying these addresses. Usually, at the start ofthe computer 10, a system initializing program such as a BIOS determinesthese addresses.

A virtual NIC list 302 holds a list of information about the virtualNICs on the virtual computers, and since the table items of the virtualNIC list 302 are the same as in the physical NIC list 301, a duplicatedescription thereof is omitted.

However, the contents of the items are not collected by the physical NICinformation collector 304 like the physical NIC list 301, but theirvalues are determined by the hypervisor 11 when the virtual computer 12is defined or at the start of the virtual computer 12 and updateddirectly by the hypervisor 11.

The method of determining the MAC address 401 is to use, e.g., a knowntechnique which randomly selects an address of a specific address spaceassigned beforehand to the hypervisor 11, and in determining variousaddresses, addresses unique on the virtual computer 12 can be assignedby using the same method as the determining method by a BIOS of PC/ATcompatibles. The detailed description of the above methods is omitted.

The addresses of the MMIO address 404 and the IO address 405 areassigned preferably unique not only on the virtual computer 12 but alsoamong all the physical NICs 101 on the computer 10 by referring to theaddress values in the virtual NIC list 302 and the physical NIC list301.

The physical-virtual NIC mapping list 303 is a list of information aboutthe association between the virtual NICs 121 on the virtual computers 12running on the computer 10 and the physical NICs 101 and held in theform of a table.

An example of the configuration of the physical-virtual NIC mapping list303 will be described using FIG. 5. FIG. 5 shows an exampleconfiguration of the physical-virtual NIC mapping list 303.

A virtual computer number 501 is an identifier uniquely identifying avirtual computer 12. A virtual NIC identifier 502 is an identifieruniquely identifying a virtual NIC 121 on the virtual computer 12, and,for example, the device mounted position 403 in the virtual NIC list 302is used.

A redundancy configuration 503 and a redundancy status 504 (statusinformation) hold the statuses when the OS 13 on the virtual computer 12is using virtual NICs 121 in a redundancy configuration. The redundancyconfiguration 503 holds a team name to team the virtual NICs 121 on thevirtual computer 12. The redundancy status 504 indicates whether thevirtual NIC 121 is of the active system or the standby system. Themethod of entering and updating the item values for the redundancyconfiguration 503 and the redundancy status 504 will be described laterin a description of the control-managing method for the control schemeof the virtual NIC 121 by the hypervisor 11.

In the present embodiment, status representations based on the premiseof a redundancy configuration are used, but not being limited to these,other status representations or more versatile ones such as accessfrequency may be used.

A physical NIC identifier 505 is an identifier uniquely identifying aphysical NIC 101 associated with a virtual NIC 121 identified by thevirtual computer number 501 and the virtual NIC identifier 502, and,e.g., information of the device mounted position 403 in the physical NIClist 301 is used.

A physical NIC using scheme 506 specifies a scheme for controllingcommands issued from the OS 13 on the virtual computer 12 to a virtualNIC 121 by the hypervisor 11. Examples of the control scheme are shownby A, B, C, etc., of FIG. 6, the details of which will be describedlater.

Information about the redundancy configuration is entered by anadministrator of the virtual computer system, according to an inputmethod described later using FIG. 13.

FIG. 6 shows an example configuration of the viral computer system. A“virtual NIC execution function” in the hypervisor 11 indicates thevirtual NIC controller 111 of FIG. 2.

As shown in FIG. 6, in this example configuration, three virtualcomputers 12-1 to 12-3 are operating and each have two virtual NICs 121(“A” to “F”; hereinafter also called a virtual NIC “A” or simply “A”,this applies to physical NICs 101 as well). Physical NICs 101 indicatedby “a” to “e” are mounted on the computer 10.

On each virtual computer 12, a pair of two virtual NICs 121 constitutesa redundancy configuration of the active and standby systems. Here, “A”,“C”, “E” operate as the active system and “B”, “D”, “F” operate as thestandby system. In usual network traffic, only the virtual NICs 121 ofthe active system are used for transmission. The virtual NICs 121 of thestandby system do not transmit data at all, or they periodicallytransmit data for communication confirmation by the OS 13 on the virtualcomputer 12.

When each individual OS 13 detects a failure in its virtual NIC 121 “A”,“C”, or “E”, the OS 13 makes a change so as to transmit data using thepaired virtual NIC 121 “B”, “D”, or “F”.

The physical NICs 101 “a”, “c”, “d” are assigned respectively to thevirtual NICs 121 “A”, “C”, “E” of the active system. The physical NIC101 “e” is assigned to the virtual NICs 121 “B”, “D”, “F” of the standbysystem and shared under a shared scheme of FIG. 8A described later.

Information about the redundancy configuration of the virtual NICs 121and the association between the virtual NICs 121 and the physical NICs101 is recorded in the physical-virtual NIC mapping list 303.

Since the physical NIC 101 “b” is assigned to no virtual NIC 121, when afailure occurs in the system and the OS 13 starts transmitting datausing the virtual NIC 121 “B”, “D”, or “F” of the standby system, thephysical NIC 101 “b” can be assigned in a dedicated manner to thevirtual NIC 121.

Next, an example of the execution method of the control by thehypervisor 11 when the virtual computer 12 executes a data transfercommand will be described with reference to FIGS. 7 and 8.

FIG. 7 shows the control method for an NIC (NIC 101 and virtual NIC 121)in the case of using memory mapped IO (hereinafter called MMIO) in orderto access the NIC 208 on the usual computer 10.

In the access method by the MMIO in the computer 10, by writing data asa command into an MMIO address 701 in the address space of the memory204 of the computer 10, the OS 13 can access a control register 702 ofthe NIC, thereby controlling the NIC. An individual MMIO address 701 isassigned to each device by, e.g., the BIOS initializing the system atthe start of the computer 10.

The MMIO address 701 of each NIC takes on a value held in a PCIconfiguration register 703 in another address space called a PCIconfiguration space of the memory 204. When changing the MMIO address701, the value in the PCI configuration register 703 is changed. For thephysical NIC 101, the value in the register needs to be unique on thecomputer 10, and for the virtual NIC 121, it needs to be unique on thevirtual computer 12.

As to the MMIO control method, an example configuration of thehypervisor 11 controlling the MMIO access in the virtual computer 12will be described using FIGS. 8A to 8C. The processing unit 115 of thehypervisor 11 shown in FIG. 2 implements each of the processing schemesA to C below.

The processing unit 115 of FIG. 2 refers to the physical NIC usingscheme 506 in the physical-virtual NIC mapping list 303 corresponding toa virtual NIC 121 to determine the processing scheme and selects andexecutes the specified processing scheme A to C, which are as follows.

FIG. 8A shows an example configuration of the processing unit 115 in thecase where a plurality of NIC functions on the virtual computer 12 sharea single physical NIC 101. Hereinafter, the scheme of FIG. 8A is calleda shared scheme.

A virtual NIC emulating unit 801 comprises a virtual NIC processing unit811 and a virtual register 812 (a hardware-specification specifiednumber of virtual configuration registers and virtual registers). Theprocessing unit 115 comprises a physical NIC device driver 813 that iscontrol software for the virtual NIC 121, as well as the virtual NICemulating unit 801.

The virtual NIC processing unit 811 and the physical NIC device driver813 are programs running on the hypervisor 11. The virtual register 812is a data store area secured in an area in the memory 204 managed by thehypervisor 11.

The virtual NIC processing unit 811 and the virtual register 812 eachexist one for each virtual NIC of the virtual computer 12.

The physical NIC device driver 813 exists one for each physical NIC 101and controls the physical NIC 101 like a usual OS device driver does.

In FIG. 8A, a unique MMIO address 1 in the virtual computer 12 isassigned to each NIC function of the virtual computer 12. The MMIOaddress 1 may be the same between the multiple virtual computers 12 onthe computer 10. The OS on the virtual computer 12 issues an IO devicecontrol command specifying the MMIO address 1 in the memory space.

When detecting access to the MMIO address 1 on the virtual computer 12,the hypervisor 11 starts emulating the virtual NIC 121. The virtual NICprocessing unit 811 of the virtual NIC emulating unit 801 reads thecontent of the access to the MMIO address 1 and executes a program foremulating the data transfer and hardware setting by the physical NIC 101and stores results of the transfer and setting in the virtual register812 as needed.

An interrupt caused by the physical NIC 101 is trapped by the physicalNIC device driver 813 and converted into an interrupt on the virtualcomputer 12 to be transmitted to the virtual computer 12.

Because in the scheme of FIG. 8A, the hypervisor 11 intervenes and theprocesses that are otherwise performed by the physical NIC 101 areemulated by a program, operation speed is low. However, a plurality ofvirtual NIC emulating units 801 can share one physical NIC 101 becausethe physical NIC device driver 813 can convert data transfer requestsreceived from a plurality of virtual NIC processing units 811 into datatransfer requests to the physical NIC 101 with consistency.

Further, even if the virtual NIC 121 on the virtual computer 12 and thephysical NIC 101 have different command specifications, because ofacting as an intermediary, the physical NIC device driver 813 can coverthe difference and thus flexibly deal with it.

FIGS. 8B and 8C show example configurations of the processing unit 115in the case where a particular physical NIC 101 is assigned to thevirtual NIC 121 on the virtual computer 12 on a one-to-one basis and thesingle physical NIC 101 executes data transfer for the single virtualNIC 121.

The scheme of FIG. 8B is used in the case where the address spaces ofthe virtual NIC 121 and of the physical NIC 101 cannot be madeidentical, or where no hardware exists which supports in translating anaddress on the virtual computer 12, used when an 10 device accessesmemory into a real address on the computer 1, among others. Hereinafter,the scheme of FIG. 8B is called an indirect dedicated scheme.

An example of hardware to translate an address can be hardware incompliance with the “Virtualization Technology for Directed I/O”specification proposed by Intel (registered trademark), but if suchhardware is not available, the indirect dedicated scheme is used to makea device (physical NIC 101) operate under a dedicated scheme.

In FIG. 8B, there is one address translator 802 for each virtual NIC 121on the hypervisor 11. The address translator 802 holds information aboutan MMIO address 2 of the physical NIC 101 associated therewith.

The OS 13 on the virtual computer 12 issues an IO device control commandspecifying the MMIO address 1 in the memory space.

When detecting access to the MMIO address 1 on the virtual computer 12,the hypervisor 11 performs the control of the virtual NIC 121. Theaddress translator 802 reads the content of the access to the MMIOaddress 1 and executes memory access having the same content to the MMIOaddress 2. Here, the address translator 802 translates the addresscontained in the read data transfer request as needed, but need not makea change or an analysis other than that.

The hypervisor 11 traps interrupts caused by the physical NIC 101 andtranslates the device identifier into a device identifier on the virtualcomputer 12 as needed and transmits the translated interrupts to thevirtual computer 12.

FIG. 8C shows an example configuration of the hypervisor 11 in the casewhere the same conditions as in FIG. 8B are true and in addition theMMIO address 1 on the virtual computer 12 and the MMIO address 2 whichthe physical NIC 101 has are identical. Hereinafter, the scheme of FIG.8C is called a direct dedicated scheme.

In FIG. 8C, the OS 13 on the virtual computer 12 issues an IO devicecontrol command specifying the MMIO address 2 in the memory space.

The data transfer request to the NIC is directly transmitted from the OS13 to the physical NIC 101.

The hypervisor 11 does not need to translate an address at all and doesnot detect access to the MMIO address 2.

As to interrupts caused by the physical NIC 101, the same method as inFIG. 8B may be used, and if the CPU 201 is assigned to the virtualcomputer 12 on a one-to-one basis, a method which directly transmits theinterrupts to the virtual computer 12 without the hypervisor 11 trappingthem may be used as well.

The premise for applying the direct dedicated scheme is the computer 10having hardware which supports in translating an address on the virtualcomputer 12 used when an IO device accesses memory into a real addresson the computer 10.

The dedicated schemes (B and C) can process at higher speed than theshared scheme A. In particular, the scheme C processes at high speedwithout overhead associated with the program. However, the scheme Brequires that the command specifications of the virtual NIC 121 and thephysical NIC 101 be the same, and it is not possible that a plurality ofvirtual NICs 121 share the physical NIC 101. Further, the scheme Crequires that the identifiers of the virtual NIC 121 and the physicalNIC 101 such as the device mounted positions match and that addressessuch as the MMIO addresses 404 be unique among the addresses of all thephysical NICs 101 of the computer 10, which limits the configurationthat it is applicable to.

In summary, with the scheme A, because the hypervisor 11 needs tooperate a program in order for the virtual computer 12 to access thephysical NIC 101, overhead occurs resulting in slow processing speed,but a plurality of virtual NICs 121 can be associated with one physicalNIC 101.

With the scheme B, because the hypervisor 11 need only translate anaddress in order for the virtual computer 12 to access the physical NIC101, processing speed is in the middle among these three schemes.

With the scheme C, because the hypervisor 11 does not need to translatean address in order for the virtual computer 12 to access the physicalNIC 101, processing speed is fast, but there is a limitation on theconfiguration of the address space and the like.

That is, there is a tradeoff between the flexibility of theconfiguration and operation (processing) speed with each scheme.

Although in the present embodiment access by means of the MMIO is usedto access the virtual NIC 121, another interface may be used such asaccess through an IO port.

Next, the method of the hypervisor 11 to manage the status of thevirtual NIC 121 will be described with reference to FIGS. 9 to 12.

FIG. 9 shows an example configuration of a virtual NIC status manager114 that manages the status of the virtual NIC 121, and the like.

Command history-statistics information 901 and process switching policy902 (check condition information) are data store areas secured in thememory 204 managed by the hypervisor 11, and each is created one foreach viral NIC 121.

The command history-statistics information 901 holds history informationof commands executed by the virtual NIC 121 and statistics informationand comprises command history information 901-1 shown in FIG. 10 andcommand statistics information 901-2 shown in FIG. 11.

FIG. 10 shows an example of the commands of the NIC. The commands arestored as data in the memory 204.

Among the commands are commands to initialize and update the settings ofthe NIC such as address settings and commands to transmit and receiveactual data.

Commands to the virtual NIC 121 are issued by the OS 13 on the computer10 through MMIO access or the like. In the shared scheme A, thehypervisor 11 reads the content of the command.

A command history-statistics unit 903 analyzes the command name 1002 ofthe command read by the hypervisor 11 to determine which recordingprocess to do.

If the command is a command to change the settings of the NIC, a datastring read as the command is copied, as it is, into a history area 1001of the command history-statistics information 901.

If the command is a command to transmit or receive, the commandhistory-statistics unit 903 increments a statistics information counter(use frequency). The counter comprises a command name and the number ofexecution times as shown in FIG. 11.

The counter is cleared in a predetermined time. By this means, thenumber of command execution times per unit time is recorded.

In the indirect dedicated scheme and the direct dedicated scheme, thecommand history-statistics information 901 may not be collected. Ifthese schemes are used, it may be that the information 901 cannot beused as a to-be-checked object 1202, described later, of the processswitching policy 902.

The process switching policy 902 includes conditions on which to changethe process that the virtual NIC 121 executes and rules specifying thecontent of the change and is stored as a data string or the like in anarea of the memory 204 managed by the hypervisor 11.

The process switching policy 902 may be specified, for example, in afixed manner by implementing the virtual computer system, or by theadministrator of the virtual computer system (hereinafter simply calledan administrator) entering through a user interface such as a GUI(Graphical User Interface) or a command line.

FIG. 12 shows an example configuration of the process switching policy902.

The process switching policy 902 includes one target status 1201, one ormore sets of a to-be-checked object 1202 and a check condition 1203, oneafter-policy-application status 1204, and one after-policy-applicationprocessing scheme 1205.

The target status 1201, the to-be-checked object 1202, and the checkcondition 1203 are conditions on which to apply this policy. Theafter-policy-application status 1204 indicates a redundancy status 504of the virtual NIC 121.

The to-be-checked object 1202 indicates management information to bereferenced to determine whether to carry out this policy, whichinformation is, for example, command history information 901-1, commandstatistics information 901-2, the device mounted position 403 or theMMIO address 404 of the virtual NIC list 302, or the like.

Examples of the check condition 1203 respectively for the types of theto-be-checked object 1202 are as follow.

(1) Command History Information

The types of commands in the command history information 901-1 (thetypes of command names 1002 in FIG. 10) are referenced. A series ofmultiple command types is compared to a series of command types writtenin the check condition 1203, and if they match, it is determined thatthe check condition 1203 is met.

(2) Command Statistics Information

The counter of the command statistics information 901-2 of FIG. 11 iscompared to the value of the check condition 1203, and if it exceeds athreshold, or if it is less than the threshold, it is determined thatthe check condition 1203 is met.

(3) Device Mounted Position/MMIO Address

For example, the device mounted position 403 or the HMO address 404 isunique on the computer 10. If true, it is determined that the checkcondition is met.

The after-policy-application status 1204 and theafter-policy-application processing scheme 1205 indicate the status andthe processing scheme after the policy is applied respectively. Theafter-policy-application status 1204 is set at the value of theredundancy status 504 of a corresponding virtual NIC 121 in thephysical-victual NIC mapping list 303, and the after-policy-applicationprocessing scheme 1205 is set at the value of the physical NIC usingscheme 506.

An NIC application change manager 904 refers to the commandhistory-statistics information 901 and the virtual NIC list 302 tosearch the process switching policy 902 for a policy that meetsconditions, and if a policy meeting the conditions exists in the processswitching policy 902, executes a process according to the policy.

The system configuration management and control procedure of thehypervisor 11 of the first embodiment will be described below.

In order to specify the system configuration of the virtual computer 12,an example of the procedure of creating the virtual NIC list 302 and thephysical-virtual NIC mapping list 303 will be described using the flowchart of FIG. 13. FIG. 13 is a flow chart showing the procedure ofentering information about the configuration of the virtual computer 12.

In the following procedure, an administrator enters information aboutthe configuration of the virtual computer 12 using a GUI or a commandline.

First, the administrator specifies the predetermined number of virtualcomputers 12 (step 1301) and assigns each virtual computer 12 a virtualcomputer number 501 unique on the computer 10 and enters it. The virtualcomputer numbers 501 may be automatically assigned by the hypervisor 11in the order in which virtual computers 12 are specified.

Next, the administrator specifies one or more virtual NICs 121(functions) which each virtual computer 12 specified at step 1301 has(step 1302).

Then, it is checked whether the MAC addresses 401 and the device mountedpositions 403 are to be automatically generated by the hypervisor 11(step 1303).

If the hypervisor 11 automatically generates the MAC addresses 401 andthe device mounted positions 403 (Yes at step 1303), the hypervisor 11automatically generates their values, for example, in the order in whichthey are specified (step 1304).

If the hypervisor 11 does not automatically generate the MAC addresses401 and the device mounted positions 403 (No at step 1303), theadministrator enters their values using a user interface or the like(step 1305).

Then, it is checked whether the model names 402 are to be automaticallygenerated by the hypervisor 11 (step 1306).

If the hypervisor 11 automatically generates the model names 402 (Yes atstep 1306), the hypervisor 11 automatically generates the model namesaccording to, e.g., a method which uses prescribed values (step 1307).

If the hypervisor 11 does not automatically generate the model names 402(No at step 1306), the administrator enters a model name using a userinterface or the like according to, e.g., a method in which the modelname is selected from, a predetermined list (step 1308).

Then, it is checked whether the associations between physical NICs 101and the virtual NICs 121 are to be automatically generated by thehypervisor 11 step 1309).

If the hypervisor 11 automatically associates physical NICs 101 with thevirtual NICs 121 (Yes at step 1309), the physical NIC assigning unit 305of the hypervisor 11 automatically assigns physical NICs 101 that meetspredetermined conditions to the virtual NICs 121 respectively accordingto a method described later and sets items, i.e., generates associations(step 1310).

If the hypervisor 11 does not automatically associate physical NICs 101with the virtual NICs 121 (No at step 1309), the administrator entersassociations using a user interface or the like (step 1311).

If virtual NICs 121 are used in redundancy configuration on the virtualcomputer 12, the administrator enters the redundancy configuration 503and the redundancy statuses 504 according to the redundancyconfiguration of the virtual NICs 121 on the virtual computer 12 (step1312). This step 1312 does not need to be performed at the same time asthe specifying of the virtual computer 12, but at any time theadministrator may enter them using the user interface, or a program toobtain and transit the status of the redundancy configuration on thevirtual computer 12 to the hypervisor 11 may be prepared, and after thestart of the virtual computer 12, the program may be executed on thevirtual computer 12 to enter them.

Items that are not entered in this input procedure are determined by thephysical NIC assigning unit 305 according to a method described later.

In this way, the virtual NIC list 302 and the physical-virtual NICmapping list 303 are created.

Next, the procedure of the NIC application change manager 904 of FIG. 9executing the policy according to the process switching policy 902, andthe like will be described using the flow chart of FIG. 14. FIG. 14 is aflow chart showing the procedure of executing the process switchingpolicy.

The NIC application change manager 904 is associated with a specifyvirtual NIC 121, and time to execute this procedure can be when thecommand history-statistics unit 903 of the virtual NIC 121 has updatedthe command history information 901-1, or just before it clears thecounter of the command statistics information 901-2, or at constant timeintervals.

First, the NIC application change manager 904 refers to or searches theprocess switching policy 902 (step 1401) and, e.g., confirms ordetermines whether a condition described using FIG. 12 is met (whetheran applicable policy exists).

If a policy whose condition is met does not exist (No at step 1402), theprocess ends.

If a policy whose condition is met exists (Yes at step 1402), the NICapplication change manager 904 updates information of the physical-vialNIC mapping list 303 using information of the after-policy-applicationstatus 1204 and the after-policy-application processing scheme 1205(step 1403). At this time, if the after-policy-application processingscheme 1205 differs from the one before the policy application,information of the physical NIC identifier 505 corresponding to thevirtual NIC 121 is changed to null.

The virtual NIC status manager 114 transmits a request having theidentifier (virtual computer number 501 and virtual NIC identifier 502)of the virtual NIC 121 corresponding to the NIC application changemanager 904 as a parameter, to assign a physical NIC 101 to the virtualNIC 121 to the physical NIC assigning unit 305 of the physical NICstatus manager 113 (step 1404).

Thereafter, having returned to step 1401, step 1401 and the subsequentsteps are repeated.

In this way, the policy can be executed by the NIC application changemanager 904, etc.

The NIC application change manager 904 may have a programming interfaceto accept an instruction to change the status from outside thehypervisor 11 and accept an instruction to change the status fromoutside via that interface. When accepting an instruction to change thestatus from outside, the after-policy-application status 1204 and theafter-policy-application processing scheme 1205 of FIG. 12 are receivedas input parameters, and steps 1403 and 1404 are executed.

Next, the method of the physical NIC assigning unit 305 of FIG. 3 toassign a physical NIC 101 to the virtual NIC 121 will be described usingthe flow chart of FIG. 15. FIG. 15 is a flow chart showing the procedureof the physical NIC assigning unit 305 to assign a physical NIC 101,etc.

When accepting a request to assign a physical NIC 101 to the virtual NIC121 from another function such as the NIC application change manager904, or at the start of the virtual computer 12, the physical NICassigning unit 305 is made to operate by the hypervisor 11 (step 1501).That request needs an identifier uniquely identifying the virtual NIC121 (the virtual computer numbers 501 and virtual NIC identifier 502) asan input parameter.

In the description below, the virtual NIC 121 uniquely identified by theinput parameter is called a virtual NIC(A).

Next, the physical NIC assigning unit 305 refers to the physical-virtualNIC mapping list 303 and confirms whether the physical NIC using scheme506 for the virtual NIC(A) has been determined (step 1502). If thephysical NIC using scheme 506 is null (has not been determined) (No atstep 1502), step 1503 is executed.

The physical NIC assigning it 305 executes steps 1401 to 1403 of FIG.14, that is, updates or determines the physical NIC using scheme 506(step 1503).

If the physical NIC using scheme 506 is not determined even after theexecution of steps 1401 to 1403, an initial value determined at theimplementation of the hypervisor 11 may be used in a dictating manner.In the present embodiment, description will be made assuming that itsinitial value indicates the use of the shared scheme.

Then, the physical NIC assigning unit 305 refers to the physical-virtualNIC mapping list 303 and confirms whether the physical NIC identifier505 has been determined for (associated with) the virtual NIC(A) (step1504). If the physical NIC identifier 505 is null, steps 1505 to 1510are executed to determine the physical NIC identifier 505 for thevirtual NIC(A).

To be specific, the physical NIC assigning unit 305, referring to thephysical NIC list 301 and the physical-viral NIC mapping list 303,searches the list of physical devices (physical NICs 101) compatiblewith the virtual NIC(A) (step 1505) and determines whether a compatiblephysical device exists (step 1506).

The method of confirming the compatibility varies depending on thephysical NIC using scheme 506, the device mounted position 403, variousaddress spaces in FIG. 7, and the like. The flow chart of an examplemethod of confirming the compatibility is shown in FIG. 16. FIG. 16 is aflow chart showing the procedure of selecting a physical NIC compatiblewith a NIC. The operation in FIG. 16 is performed by the physical NICassigning unit 305.

Hereinafter, a physical NIC 101 to be examined as to whether it iscompatible with the virtual NIC(A) is called a physical NIC(B).

If the physical NIC using scheme 506 is the direct dedicated scheme (Yesat step 1601), in order to be determined to be compatible, it isnecessary that the computer 10 do not have the function of translatingdevice identification numbers (No at step 1602), that the virtual NIC(A)and the physical NIC(B) match in terms of the model name 402 and devicemounted position 403 (device identifiers) (Yes at step 1603), and thatthe MMIO address 404 and IO address 405 of the virtual NIC(A) be uniqueamong all physical NICs 101 (Yes at step 1604).

If the physical NIC using scheme 506 is the indirect dedicated scheme(No at step 1601 and Yes at step 1605), in order to be determined to becompatible, it is necessary that the physical NIC(B) be not associatedwith the virtual NIC(A) (No at step 1606), and that the virtual NIC(A)and the physical NIC(B) match in terms of the model name 402 (Yes atstep 1607).

Also, after step 1604, the process proceeds through step 1606 and thesubsequent steps.

Referring back to FIG. 15, if at step 1506 no compatible physical NIC101, exists, the physical NIC using scheme 506 is changed (step 1507).If the change is successful (Yes at step 1508), step 1505 and thesubsequent steps are repeated.

The physical NIC assigning unit 305 changes the physical NIC usingscheme 506 of the virtual NIC(A) in the order predetermined byimplementation. For example, in the order of the direct dedicatedscheme, the indirect dedicated scheme, and the shared scheme, the valueof the physical NIC using scheme 506 is changed. Although in the presentembodiment the predetermined order is used, a table that specifies thechange order may, be created beforehand on the hypervisor 11, and it maybe changed in the order specified in the table. If, having changed thephysical NIC using scheme 506 a predetermined number, zero or greater,of times, a compatible device cannot be found (i.e., the change is notsuccessful) (No at step 1508), then a process for the failure to assigna physical NIC 101 is performed (step 1511) and the process ends.

If more than one compatible physical NIC 101 has been found (Yes at step1506), the physical NIC assigning unit 305 selects one physical NIC 101(a physical device) according to a predetermined procedure (step 1509).An example of the selecting procedure is to select the physical NIC 101that was found first.

Then, the physical NIC assigning unit 305 changes the value of thephysical NIC identifier 505 for the virtual NIC(A) in thephysical-virtual NIC mapping list 303 to the identifier of the physicalNIC 101 selected at step 1509 (step 1510).

In this way, a physical NIC 101 can be assigned to the virtual NIC 121.

After the procedure of FIG. 15 finishes, the physical NIC assigning unit305 performs a physical NIC initializing procedure on the physical NIC101 assigned to the virtual NIC(A). An example of the procedure forinitializing the physical NIC 101 will be described using the flow chartof FIG. 17. FIG. 17 is a flow chart of the procedure for initializingthe physical NIC 101.

When performing the procedure for initializing the physical NIC 101, thephysical NIC identifier 505 is necessary as an input parameter.Hereinafter, the physical NIC 101 identified by the physical NICidentifier 505 is called a physical NIC(B), and the virtual NICassociated with the physical NIC(B) is called the it NIC(A).

The physical NIC assigning unit 305 refers to the physical-virtual NICmapping list 303 and obtains the physical NIC using scheme 506 for thephysical NIC(B). When the physical NIC using scheme 506 is the directdedicated scheme (Yes at step 1701), the assigning unit 305 searches forthe PCI configuration register 703 (see FIG. 7) of the physical NIC(B)with the physical NIC identifier 505 as a search key value and updates(replaces) the values of the MMIO address and, address of thecorresponding register with the values of those of the vial NIC(A) (step1702).

The physical NIC assigning unit 305 refers to the command historyinformation 901-1 for the virtual NIC(A) and confirms whether commands(command names 1002) in the command history information 901-1 arerecorded (step 1703). If commands are recorded (Yes at step 1703), theearliest command (the command history information 901-1) is read (step1704) and issued to the physical NIC(B) (step 1705).

The physical NIC assigning unit 305 deletes the command which was issuedat step 1705 from the list of the command history information 901-1(step 1706). The deleting method depends on the implementation. Forexample, if the command history information 901-1 is implemented in theform of a ring buffer, the deleting is performed by incrementing thepointer address of the ring buffer.

The physical NIC assigning unit 305 overwrites (updates) the values ofvarious registers of the physical NIC(B) with the contents of thevirtual register 812 for the virtual NIC(A) (step 1707).

Further, the physical NIC assigning unit 305 sets an interrupt handler(step 1708) and updates information (a specifying table, or the like;not shown) about an ownership relation between the virtual computer 12and the physical NIC 101 in hardware of the computer 10 as needed (step1709).

An example of the hardware information is domain information and cacheinformation described in the specification of “Virtualization Technologyfor Directed I/O” released by Intel (registered trademark). The domaininformation is information indicating a correspondence between thephysical NIC identifier 505 and the virtual computer number 501. Thecontext cache information is information indicating a correspondencebetween the virtual NIC identifier 502 and the physical NIC identifier505.

In this way, the physical NIC 101 can be initialized.

Next, the control procedure for the entire virtual computer system whendynamically changing the processing scheme for the virtual NIC 121 onthe system of the example configuration shown in FIG. 6 will bedescribed using FIGS. 18 and 19.

(First Example Operation)

As a first example operation, an example control procedure of, where afailure having occurred in an NIC of the active system on the virtualcomputer 12, operation has been passed from the active NIC to a standbyNIC, changing the scheme for the physical NIC 101 from the shared schemeto the direct dedicated scheme will be described using the sequence ofFIG. 18. FIG. 18 shows an example sequence of the operation of thehypervisor 11 when changing from the shared scheme to the directdedicated scheme. In this example operation sequence, the processswitching policy 902 of FIG. 12 is used as an example of the policy.

In normal times, the OS 13 of a virtual computer 12-1 issues a datatransmit command to a physical NIC “a” recognized as a virtual NIC “A”(step 1801).

The virtual NIC “A” is assigned to the physical NIC “a” under the directdedicated scheme, and the NIC control command to the virus NIC “A” istransferred to the physical NIC “a” directly, not via the hypervisor 11.

If a failure occurs in the physical NIC “a”, the failure of the datatransmit command from the OS 13 or the link down of the physical NIC“a”, is detected, and the OS 13 switches the NIC used in datatransmission to a virtual NIC “B” on the virtual computer 12-1 (step1802).

Because the step 1802 is performed on the virtual computer 12-1, thehypervisor 11 cannot directly detect the occurrence of the switching.

The control command issued to the virtual NIC “B” is sent to the commandhistory-statistics unit 903 of the virtual NIC “B”. The commandhistory-statistics unit 903 analyzes the data transmit command andupdates the command history-statistics information 901 (ahistory-statistics process) (step 1803). Thereafter, the processing unit115 of the virtual NIC “B” analyzes the command and emulates itsfunction (execute the command) with a program under the shared scheme(step 1804).

Also after step 1804, the same process as step 1803 is performed (step1804-2).

In response to the update of the command history-statistics information901 or at constant time intervals, the NIC application change manager904 confirms the policy according to the procedure described in FIG. 14(step 1805).

When detecting that the number of transmit packets per unit time in thevirtual NIC “B” of the standby system exceeds a predetermined value, theNIC application change manager 904 applies the policy and changes theredundancy status 504 and physical NIC using scheme 506 of thephysical-virtual NIC mapping list 303 (step 1806).

The physical NIC assigning unit 305 checks the status of the processingunit 115 of the virtual NIC “B” (the processing unit 115 of the virtualNIC controller 111 for the virtual NIC “B”; the same applieshereinafter) (step 1807). The physical NIC assigning unit 305 waitsuntil the virtual NIC “B” reads a new command or becomes idle with nocommand to be processed, at which time the assigning unit 305 instructsthe processing unit 115 to stop executing commands. Thereafter, theprocessing unit 115 stops executing commands.

The physical NIC assigning unit 305 searches for a physical NICcompatible with the virtual NIC “B” according to the method of FIG. 15.

The device identification number (MAC address 401) of a physical NIC “b”matches that of the virtual NIC “B”, and the MMIO address 404 of thevirtual NIC “B” is unique among all physical NICs 101 on the computer10. Hence, the physical NIC “b” is confirmed to be compatible (Yes atstep 1506 of FIG. 15) and is selected and associated with the virtualNIC (step 1808).

Next, the physical NIC assigning unit 305 replaces the values of theMMIO, address 404, IO address 405, and register of the physical NIC “b”with those of the virtual NIC “B” according to the procedure describedin FIG. 17 and re-executes a setting command recorded in the commandhistory information 901-1 to initialize the physical NIC “b” (step1809).

After the execution of step 1809, when it is time to read a command asdescribed at step 1807, the processing unit of the virtual NIC “B” ofthe standby system issues (transfers) the read command to the physicalNIC “b” (step 1810).

Because the physical NIC “b” has taken over various addresses of thevirtual NIC “B”, at step 1810 and later, commands are directly issuedfrom the OS 13 on the virtual computer 12 to the physical NIC “b” andthe resultant status is checked directly by the OS 13 (step 1811).

By the above procedure, assigning the physical NIC “b” to the virtualNIC “B” in a dedicated manner with the high speed implementing method ofthe direct dedicated scheme is achieved.

(Second Example Operation)

As a second example operation, an example control procedure of, where afailure having occurred in an NIC of the active system on the virtualcomputer 12, operation has been passed from the active NIC to a standbyNIC, changing the scheme for the physical NIC 101 to the indirectdedicated scheme will be described using FIG. 19. FIG. 19 shows anexample sequence of the operation of the hypervisor 11 when changingfrom the shared scheme to the indirect dedicated scheme.

The operation of FIG. 19 is the same in outline as that of FIG. 18 butdifferent in the operation of the physical NIC assigning unit 305 andthe subsequent processes. Since steps 1901 to 1909 of FIG. 19 are thesame as steps 1801 to 1807 of FIG. 19, description will be omitted.

After step 1909, the physical NIC assigning unit 305 searches for aphysical NIC compatible with the virtual NIC “D” according to the methodof FIG. 15. However, the device identification number of the physicalNIC “b” does not match that of the virtual NIC “D”, so that it is notrecognized as a compatible device (step 1910).

Then, the physical NIC assigning unit 305 executes the procedure of step1507 in FIG. 15. In this example operation, the physical NIC usingscheme 506 is changed from the direct dedicated scheme to the indirectdedicated scheme.

The physical NIC assigning unit 305 again searches for a compatiblephysical NIC that meets that condition. Since the physical NIC “b” isthe same in model name as the virtual NIC “D”, it is confirmed as acompatible device and selected as a device for the indirect dedicatedscheme (step 1911).

Next, the physical NIC assigning unit 305 replaces the register valueswith the values of the virtual NIC “D” according to the procedure ofFIG. 17 and re-executes a setting command recorded in the commandhistory information 901-1 to initialize the physical NIC “b” (step1913).

By this means, at step 1913 and later, data transmit commands (steps1915, 1917) and the like to the NIC from the virtual computer 12-2 areonce transferred to the processing unit of the virtual NIC “D”, whichreplaces the device identifier and address according to the indirectdedicated scheme and issues (transfers) the identifier-replaced commandto the physical NIC “b” (steps 1914, 1916, 1918).

As such, also in the case of a system configuration to which the directdedicated scheme is not applicable, the processing scheme can be changedaccording to the above predetermined procedure such that a physical NIC101 is assigned to a virtual NIC 121 in a dedicated manner.

As shown in the first and second example operation, by using the virtualcomputer system of the present embodiment, in the case where a pluralityof virtual NICs 121 are being used as the standby system on the virtualcomputer 12, by the virtual NICs 121 sharing one physical NIC 101, thenumber of physical NICs 101 can be reduced. Further, the status of thevirtual NIC 121 is managed according to the change in their usage, andthe control is performed which, referring to the system configuration,assigns a physical NIC 101 to a virtual. NIC 121 in a dedicated manneraccording to a predetermined procedure, thus achieving control whichselects a data transfer process with low overhead.

Second Embodiment

A second embodiment takes on the same system configuration as the firstembodiment. With the configuration of the first embodiment, changes inprocess are as follows.

At the step 1505 of FIG. 15 performed by the physical NIC assigning unit305, if a compatible device for the direct dedicated scheme does notexist and a compatible device for the indirect dedicated scheme isfound, a notice of updating device information is transmitted to the OS13 on the virtual computer 12 without performing the initializingprocess of FIG. 17.

For example, an existing method, the device Hot Plug, can be used forthe update notice, and hence details will be omitted.

An example of the process for when the device mounted position 403 isdifferent between the victual NIC 121 and the physical NIC 101 is tosend a notice of adding a device with the device mounted position 403 ofthe physical NIC 101 specified and then a notice of deleting a devicewith the device mounted position 403 of the virtual NIC 121 specified.

Further, when the physical-virtual NIC mapping list 303 is updated atstep 1510, various addresses and the device mounted position 403 of thevirtual NIC 121 are updated to the values of the physical NIC 101.

The OS 13 on the virtual computer 12 re-initializes the device driverfor the device specified in the notice.

By this means, the OS 13 on the virtual computer 12 is notified that thedevice mounted position 403 and various addresses such as MMIO address404 of the virtual NIC 121 have been updated. Hence, the high speeddirect transfer scheme, not the indirect dedicated scheme, can be used.

The embodiments have been described, but the present invention is notlimited to these.

For example, the embodiments have been described taking an NIC as anexample, but the present invention can also be applied to other devicessuch as a SCSI card.

Further, when changing the control scheme for a virtual device, thehypervisor may have the current use status of the virtual devicedisplayed on the display (not shown) of the computer.

Yet further, for the control of virtual devices on a virtual computer,one or more other control schemes as well as the shared scheme and thededicated scheme may be provided, and from the three or more controlschemes, an appropriate one may be selected and switched to.

As to hardware, flow charts, and specific configurations, changes can bemade thereof without departing from the scope of the present invention.

1. A computer in which functions of its resources including a processingunit and memory are divided to realize a plurality of virtual computersand which includes a plurality of physical devices that are peripheralconnecting devices or network connecting devices, the computercomprising: a managing unit that includes the processing unit and thememory, manages the plurality of virtual computers and the plurality ofphysical devices, assigns the virtual computers the physical devices soas to function as virtual devices, and manages the virtual devicesaccording to one of a plurality of control schemes including a dedicatedscheme where a virtual device is associated with a physical device on aone-to-one basis and a shared scheme where plural virtual devices areassociated with one physical device, wherein the managing unit has:status information holding use-status information indicating either anactive status where the virtual device is in use or an inactive statuswhere the virtual device is hardly or not at all in use; configurationinformation holding information about configurations includingrespective address spaces of the physical devices and the virtualdevices; and association information holding information aboutassociation between the physical devices and the virtual devices, andwherein the managing unit refers to the status information and, whendetermining that usage of the virtual device has changed from an activeusage to a standby usage or from the standby usage to the active usage,referring to the configuration information and the associationinformation, searches for a physical device compatible with a controlscheme of the virtual device, determines whether or not there is aphysical device compatible with the virtual device among the searchedphysical devices based on at least one of a hardware specification, anidentifier, and an address space, and when there are one or morephysical devices compatible with the virtual device, the managing unitselects one of the one or more physical devices compatible with thevirtual device, and makes the one of the one or more physical devicescompatible with the virtual device, be associated with the virtualdevice in the association information, and when there is not anyphysical device compatible with the virtual device, the managing unitchanges the control scheme of the virtual device stored in theassociation information to a differing control scheme of plural controlschemes, as a changed control scheme, and when a physical devicecompatible with the changed control scheme of the virtual device iscompatible with the virtual device, the managing unit makes the physicaldevice compatible with the changed control scheme be associated with thevirtual device in the association information; and wherein there are twotypes of the dedicated scheme, including a direct dedicated scheme wherecommands issued from the virtual computer to the virtual device can bedirectly transmitted to the associated physical device, and an indirectdedicated scheme where the managing unit translates commands issued fromthe virtual computer to the virtual device in terms of address andtransmits the translated commands to the associated physical device. 2.The computer according to claim 1, wherein the managing unit further hascheck-condition information holding a check condition of usage of thevirtual device for checking whether the virtual device is in the activestatus or the inactive status of use and information about the controlscheme that is applied when the virtual device meets the checkcondition, wherein referring to the status information and thecheck-condition information, the managing unit determines that usage ofthe virtual device has changed.
 3. The computer according to claim 2,wherein the check condition is information about the type of a commandthat is issued from the virtual computer to the virtual device.
 4. Thecomputer according to claim 2, wherein the check condition is athreshold for use frequency of the virtual device.
 5. The computeraccording to claim 1, wherein the managing unit stores settings of anewly selected virtual device, and initializes settings of theassociated physical device according to the control scheme of thevirtual device and copies the stored settings of the virtual device intothe physical device.
 6. The computer according to claim 1, wherein if,referring to the configuration information, determining that no physicaldevice is compatible with the virtual device, the managing unittransmits a request to update settings of a device driver, which iscontrol software for the virtual device, to an operating system on thevirtual computer, thereby making the virtual computer implement thedirect dedicated scheme.
 7. The computer according to claim 1, whereinwhen changing the control scheme of the virtual device, the managingunit has the use status of the virtual device at least either before orafter the change displayed on a display of the computer.
 8. A controlmethod for virtual devices by a computer in which functions of itsresources including a processing unit and memory are divided to realizea plurality of virtual computers and which includes a plurality ofphysical devices that are peripheral connecting devices or networkconnecting devices, the computer including a managing unit that includesthe processing unit and the memory: the control method comprising: themanaging unit managing the plurality of virtual computers and theplurality of physical devices, assigning the virtual computers thephysical devices so as to function as virtual devices, and managing thevirtual devices according to one of a plurality of control schemesincluding a dedicated scheme where a virtual device is associated with aphysical device on a one-to-one basis and a shared scheme where pluralvirtual devices are associated with one physical device, wherein themanaging unit has: status information holding use-status informationindicating either an active status where the virtual device is in use oran inactive status where the virtual device is hardly or not at all inuse; configuration information holding information about configurationsincluding respective address spaces of the physical devices and thevirtual devices; and association information holding information aboutassociation between the physical devices and the virtual devices, andwherein the control method further comprising the managing unitreferring to the status information and, when determining that usage ofthe virtual device has changed from an active usage to a standby usageor from the standby usage to the active usage, referring to theconfiguration information and the association information, searches fora physical device compatible with a control scheme of the virtualdevice, determines whether or not there is a physical device compatiblewith the virtual device among the searched physical devices based on atleast one of a hardware specification, an identifier, and an addressspace, and when there are one or more physical devices compatible withthe virtual device, the managing unit selects one of the one or morephysical devices compatible with the virtual device, and makes the oneof the one or more physical devices compatible with the virtual devicebe associated with the virtual device in the association information,and when there is not any physical device compatible with the virtualdevice, the managing unit changes the control scheme of the virtualdevice stored in the association information to a differing controlscheme of plural control schemes, as a changed control scheme, and whena physical device compatible with the changed control scheme of thevirtual device is compatible with the virtual device, the managing unitmakes the physical device compatible with the changed control scheme beassociated with the virtual device in the association information; andwherein there are two types of the dedicated scheme including a directdedicated scheme where commands issued from the virtual computer to thevirtual device can be directly transmitted to the associated physicaldevice, and an indirect dedicated scheme where the managing unittranslates commands issued from the virtual computer to the virtualdevice in terms of address and transmits the translated commands to theassociated physical device.
 9. The control method for virtual devicesaccording to claim 8, wherein the managing unit further hascheck-condition information holding a check condition of usage forchecking whether the virtual device is in the active status or theinactive status of use and information about the control scheme that isapplied when the virtual device meets the check condition, wherein if,referring to the check-condition information, determining that usage ofthe virtual device has changed, the managing unit, referring to theconfiguration information, selects a physical device compatible with thevirtual device from the physical devices usable for a control schemebased on at least one of a hardware specification, an identifier, and anaddress space, and makes the physical device be associated with thevirtual device in the association information and changes the controlscheme of the virtual device.
 10. The control method for virtual devicesaccording to claim 9, wherein the check condition is information aboutthe type of a command that is issued from the virtual computer to thevirtual device.
 11. The control method for virtual devices according toclaim 9, wherein the check condition is a threshold for use frequency ofthe virtual device.
 12. The control method for virtual devices accordingto claim 8, wherein the managing unit stores settings of a newlyselected virtual device, and initializes settings of the associatedphysical device according to the control scheme of the virtual deviceand copies the stored settings of the virtual device into the physicaldevice.
 13. The control method for virtual devices according to claim 8,wherein if, referring to the configuration information, determining thatno physical device is compatible with the virtual device, the managingunit transmits a request to update settings of a device driver, which iscontrol software for the virtual device, to an operating system on thevirtual computer, thereby making the virtual computer implement thedirect dedicated scheme.
 14. The control method for virtual devicesaccording to claim 8, wherein when changing the control scheme of thevirtual device, the managing unit has the use status of the virtualdevice at least either before or after the change displayed on a displayof the computer.